STEP 6: Time to add our first if statement! Make sure to test your if-statement by running your program multiple times.

  • In LOGIC, click on and drag out If. Drop it at the bottom of your program.
  • Change the test variable in the if statement to rand_answer.
  • Change the test value in the if statement to 1.
  • Go to and drag Say out into your if statement. Change the name in front to tim.

To navigate the page using the TAB key, first press ESC to exit the code editor.

# THIS ACTIVITY IS IN PREVIEW ONLY MODE
  • Run Code
  • Submit Work
  • Next Activity
  • Show Console
  • Reset Code Editor
  • Codesters How To (opens in a new tab)